package com.tange.ai.iot.client.gnssa.utils

import com.tange.base.toolkit.DateUtil
import java.util.*


fun Long.asTime(): String {
    var time = ""
    if (this <= 0) return time
    try {
        time = DateUtil.getStrToTime(this)
    } catch (_: Throwable) { }
    return time
}

fun Long.asTime(timeZone: TimeZone): String {
    var time = ""
    if (this <= 0) return time
    try {
        time = DateUtil.getStrToTime(this, timeZone)
    } catch (_: Throwable) { }
    return time
}

fun Long.asTimeWithMs(): String {
    var time = ""
    if (this <= 0) return time
    try {
        time = DateUtil.getStrToTimeWithMs(this)
    } catch (_: Throwable) { }
    return time
}